let query = require("./db").query
let queryPromise = require("./db").queryPromise
// let sql = "SELECT * from myshop.user WHERE user_id=?"
// let values = [1]
// let sql = "SELECT count(*) from myshop.user where username=? and `password`=?"
// // let values = ["user","user1"]
// query(sql,values,function(err,results){
//   console.log(results[0])

// let user_id = req.session.user_id
// let sql = "select * from user_role where user_id = ?"
// let sql = "select * from role_menu where role_id=?"
// let values = [1]
// query(sql,values,function(err,results){
//   console.log(results)
// })
// })


let sql = "select * from user_role where user_id=?"
let values = [1]
async function test(){
  let {results} = await queryPromise(sql,values)
  console.log(results)
}
test()